home *** CD-ROM | disk | FTP | other *** search
/ Leonardo the Inventor / Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso / LEOWINMV / DATABASE.DIR / 00097_Script_EQUIVALENT TERMS < prev    next >
Text File  |  1996-03-28  |  1KB  |  35 lines

  1. -- ---------------------------------------------------------------
  2. -- Handler initalizeEquivalentTerms initializes the global variable
  3. -- equivalentTerms to the field "equivalent terms" for use in
  4. -- hypertexting.
  5.  
  6. on initalizeEquivalentTerms
  7.   global equivalentTerms
  8.   
  9.   set equivalentTerms =  field "equivalent terms"
  10. end
  11.  
  12.  
  13. -- ---------------------------------------------------------------
  14. -- Handler getEquivalentTerm returns a topic's equivalent term
  15. -- by looking up the term in the global property list equivalentTerms
  16. -- and returning the value of the property
  17.  
  18. on getEquivalentTerm whichTerm
  19.   global equivalentTerms
  20.   
  21.   set foundEqTerm = FALSE
  22.   set eqTermLine = binSearchFirstItemInLine(equivalentTerms, whichTerm, ":")
  23.   if (eqTermLine > 0) then 
  24.     set foundEqTerm = TRUE
  25.     set the itemDelimiter = ":"
  26.     set eqTerm = item 2 of line eqTermLine of equivalentTerms
  27.     set the itemDelimiter = ","
  28.     return eqTerm
  29.   end if
  30.   
  31.   if not(foundEqTerm) then
  32.     return -1
  33.     alert("Could not find equivalent term for" && whichTerm)
  34.   end if
  35. end